//
//  AppDelegate.m
//  PPScaleDemo
//
//  Created by 彭思远 on 2021/3/10.
//

#import "AppDelegate.h"
#import "MainViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    
    [[IdentityManager manager] readCurrentUserData];
    
    [IQKeyboardManager sharedManager].shouldResignOnTouchOutside = YES;
    [IQKeyboardManager sharedManager].enable = YES;
    [IQKeyboardManager sharedManager].enableAutoToolbar = NO;
    [IQKeyboardManager sharedManager].keyboardDistanceFromTextField = 10.0f;
    
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.rootViewController = [MainViewController new];
    [self.window makeKeyAndVisible];
    
    
    
    CGFloat weight =  59.9 ;
    
    NSInteger impedance = 503;
    
    //sex PPUserGenderFemale | PPUserGenderMale
    //height 100-220
    //age 10-99
    PPUserModel *user = [[PPUserModel alloc] initWithUserHeight:158
 gender:PPUserGenderFemale age:28 pregnantMode:NO athleteMode:NO andUnit:PPUnitKG];
    
    PPDeviceModel *deviceModel = [[PPDeviceModel alloc] init];
    
    
    //PPDeviceCalcuteTypeDirect, // 直流算法
    //PPDeviceCalcuteTypeAlternate, // 交流算法
    
    deviceModel.deviceCalcuteType = PPDeviceCalcuteTypeAlternate;
   
    PPBodyFatModel *fatModel = [[PPBodyFatModel alloc] initWithUserModel:user deviceModel:deviceModel weight:weight heartRate:0 isHeartRateEnd:YES unit:PPUnitKG andImpedance:503];
    
    
    NSLog(@"%@",fatModel);
    
    return YES;
}



@end
